﻿using System;
using System.Runtime.InteropServices;

namespace HelperLib
{
   public struct KukaCoordData
   {
      public KukaCoordinates Coordinates;
      public KukaCoordType CoordType;
   }

   public enum KukaCoordType
   {
      AxisCoords,
      WorldCoords
   }

   [Serializable]
   [StructLayout(LayoutKind.Explicit)]
   public struct KukaCoordinates
   {
      //AxisCoords
      [FieldOffset(0)]
      public double A1;
      [FieldOffset(sizeof(double) * 1)]
      public double A2;
      [FieldOffset(sizeof(double) * 2)]
      public double A3;
      [FieldOffset(sizeof(double) * 3)]
      public double A4;
      [FieldOffset(sizeof(double) * 4)]
      public double A5;
      [FieldOffset(sizeof(double) * 5)]
      public double A6;

      //WorldCoords
      [FieldOffset(0)]
      public double A;
      [FieldOffset(sizeof(double) * 1)]
      public double B;
      [FieldOffset(sizeof(double) * 2)]
      public double C;
      [FieldOffset(sizeof(double) * 3)]
      public double X;
      [FieldOffset(sizeof(double) * 4)]
      public double Y;
      [FieldOffset(sizeof(double) * 5)]
      public double Z;
   }
}
